<template>
  <div id="table" class>
    <el-row>
      <el-col :span="24">
        <div class="table-grid-content list-table btnDiy">
          <div style="display: flex;justify-content: space-between;">
            <div class="tag-views-title">
              {{ $t('查询视图') }}：
              <el-button size="mini" @click="managementView">{{ $t('管理视图') }}</el-button>
              <el-button size="mini" @click="addView">{{ $t('新建视图') }}</el-button>
              <el-button v-if="searchQueryList && searchQueryList.length > 0 || showSaveBtn" size="mini" type="primary" @click="openSaveView">{{ $t('保存视图') }}</el-button>
            </div>
            <div>
              <el-button v-hasPermi="[hasPermiImportBtn]" size="mini" @click="upload.open = true">{{ $t('导入') }}</el-button>
              <el-button v-hasPermi="[hasPermiExportBtn]" size="mini" @click="exportDeal()">{{ $t('导出') }}</el-button>
              <!--            <router-link-->
              <!--              target="_blank"-->
              <!--              :to="{ path:'/batchDealImport', query: { dealType: this.dealType } }"-->
              <!--              class="link_a"-->
              <!--            >-->
              <!--              <el-button-->
              <!--                type="primary"-->
              <!--                icon="el-icon-plus"-->
              <!--                size="mini"-->
              <!--              >{{ $t('批量添加') }}</el-button>-->
              <!--            </router-link>-->
              <el-button
                v-if="dealType === 'property'"
                v-hasPermi="[hasPermiBtn]"
                type="primary"
                icon="el-icon-plus"
                size="mini"
                @click="addPropertyHandle"
              >{{ $t('添加') }}</el-button>
              <el-button
                v-else-if="dealType === 'lease'"
                v-hasPermi="[hasPermiBtn]"
                type="primary"
                icon="el-icon-plus"
                size="mini"
                @click="addLeaseHandle"
              >{{ $t('添加') }}</el-button>
              <el-button
                v-else-if="dealType === 'securities'"
                v-hasPermi="[hasPermiBtn]"
                type="primary"
                icon="el-icon-plus"
                size="mini"
                @click="addSecuritiesHandle"
              >{{ $t('添加') }}</el-button>
              <el-button
                v-else
                v-hasPermi="[hasPermiBtn]"
                type="primary"
                icon="el-icon-plus"
                size="mini"
                @click="addHandle"
              >{{ $t('添加') }}</el-button>
            </div>
          </div>
          <div v-if="$route.query.fundType === 'fof'" class="hide-add-deal-list-btn" />
          <div class="viewItem">
            <ul class="list-views">
              <li
                v-for="(item,index) in listSysSearch"
                :key="index"
                :class="[{selected: activeItem === item.viewId}]"
                :style="{'background':item.color}"
                @click="sysSearchActive(item)"
              >
                <div class="tag-number">{{ item.count }}</div>
                <div class="tag-label">{{ $t(item.viewName) }}</div>
              </li>
            </ul>
          </div>
        </div>
      </el-col>
    </el-row>

    <!-- 表格 -->
    <div class="Table-table list-table">
      <div v-if="data && data.total > 0" v-loading="treeLoading" style="min-width: 240px;margin-right: 20px;text-align: right;max-height: 450px;overflow: auto">
        <i class="el-icon-close" style="text-align: right" @click.stop="closeGroup" />
        <el-tree
          ref="tree"
          :data="data.rows"
          default-expand-all
          node-key="label"
          highlight-current
          @node-click="handlerClick"
        />
      </div>
      <div v-loading="loading" class="tableDiv">
        <el-table :show-summary="true" :summary-method="getSummaries" tooltip-effect="darkTable" :data="dealBaseList" class="nowrapTable showOnlyLine sortTable table" border @sort-change="dataSort">
          <!-- eslint-disable -->
          <el-table-column
            v-for="(item, index) in showFieldList"
            v-if="item.isShow === 'Y' && item.fieldName !== '是否关注'"
            :key="index"
            sortable="custom"
            :min-width="item.width"
            :label="$t(item.fieldRemark)"
            :prop="item.fieldName"
            show-overflow-tooltip
            :fixed="item.isShow === 'Y' && item.isFixed === 'Y'"
          >
            <template slot="header">
              <span class="fieldName">
                <p :title="$t(item.fieldRemark)">{{ $t(item.fieldRemark) }}</p>
              </span>
              <fieldQuery :field-val="item" @queryData="getQueryData" @group="groupData" />
            </template>
            <template slot-scope="scope">
              <div v-if="item.fieldName === '项目名称'" class="focusTit">
                <Focus @change="starChange" :source-id="scope.row['项目ID']" :focus="scope.row['是否关注']" :source-name="scope.row['项目名称']" focus-type="deal" />
                <router-link
                  v-if="scope.row['标的公司ID'] !== undefined"
                  target="_blank"
                  :to="{path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, companyId:scope.row['标的公司ID'],menuKey: menuKey, showType: 'deal'}}"
                  class="link_a"
                  @click.native="recorePath({ fromPath: $route.fullPath, path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, companyId:scope.row['标的公司ID'],menuKey: menuKey, showType: 'deal'}})"
                >
                  {{ $t(scope.row['项目名称']) }}
                </router-link>

                <router-link
                  v-if="scope.row['融资方ID'] !== undefined"
                  target="_blank"
                  :to="{path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, companyId:scope.row['融资方ID'],menuKey: menuKey, showType: 'deal'}}"
                  class="link_a"
                  @click.native="recorePath({ fromPath: $route.fullPath, path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, companyId:scope.row['融资方ID'],menuKey: menuKey, showType: 'deal'}})"
                >
                  {{ $t(scope.row['项目名称']) }}
                </router-link>

                <router-link
                  v-if="scope.row['工商ID'] !== undefined"
                  target="_blank"
                  :to="{path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, gpId:scope.row['管理公司ID'], companyId:scope.row['工商ID'],menuKey: menuKey, showType: 'deal'}}"
                  class="link_a"
                  @click.native="recorePath({ fromPath: $route.fullPath, path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, gpId:scope.row['管理公司ID'], companyId:scope.row['工商ID'],menuKey: menuKey, showType: 'deal'}})"
                >
                  {{ $t(scope.row['项目名称']) }}
                </router-link>
              </div>
              <div v-else-if="item.fieldName === '子基金名称'">
                <router-link
                  v-if="scope.row['标的公司ID'] !== undefined"
                  target="_blank"
                  :to="{path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, companyId:scope.row['标的公司ID'],menuKey: menuKey, showType: 'deal'}}"
                  class="link_a"
                  @click.native="recorePath({ fromPath: $route.fullPath, path:'/deal/home/dealBaseHome',query:{id:scope.row['项目ID'],dealType: dealType, companyId:scope.row['标的公司ID'],menuKey: menuKey, showType: 'deal'}})"
                >
                  {{ $t(scope.row['子基金名称']) }}
                </router-link>
              </div>

              <router-link
                v-else-if="item.fieldName === '标的公司名称'"
                target="_blank"
                :to="{path:'/company/base/companyBaseHome',query:{companyId:scope.row.标的公司ID,'source':'DEAL_EQUITY'}}"
                class="link_a"
                @click.native="recorePath({ fromPath: $route.fullPath, path:'/company/base/companyBaseHome',query:{companyId:scope.row.标的公司ID,'source':'DEAL_EQUITY'}})"
              >
                {{ $t(scope.row['标的公司名称']) }}
              </router-link>
              <router-link
                v-else-if="item.fieldName === '公司名称'"
                target="_blank"
                :to="{path:'/company/base/companyBaseHome',query:{companyId:scope.row.标的公司ID,'source':'DEAL_EQUITY'}}"
                class="link_a"
                @click.native="recorePath({ fromPath: $route.fullPath, path:'/company/base/companyBaseHome',query:{companyId:scope.row.标的公司ID,'source':'DEAL_EQUITY'}})"
              >
                {{ $t(scope.row['公司名称']) }}
              </router-link>
              <router-link
                v-else-if="item.fieldName === '基金名称'"
                target="_blank"
                :to="{path:'/company/base/companyBaseHome',query:{companyId:scope.row.工商ID}}"
                class="link_a"
                @click.native="recorePath({ fromPath: $route.fullPath, path:'/company/base/companyBaseHome',query:{companyId:scope.row.工商ID,'source':'DEAL_EQUITY'}})"
              >
                {{ $t(scope.row['基金名称']) }}
              </router-link>
              <router-link
                v-else-if="item.fieldName === '融资方名称'"
                target="_blank"
                :to="{path:'/company/base/companyBaseHome',query:{companyId:scope.row.融资方ID}}"
                class="link_a"
                @click.native="recorePath({ fromPath: $route.fullPath, path:'/company/base/companyBaseHome',query:{companyId:scope.row.融资方ID}})"
              >
                {{ $t(scope.row['融资方名称']) }}
              </router-link>
              <router-link
                v-else-if="item.fieldName === '发行方名称'"
                target="_blank"
                :to="{path:'/company/base/companyBaseHome',query:{companyId:scope.row.发行方ID}}"
                class="link_a"
                @click.native="recorePath({ fromPath: $route.fullPath, path:'/company/base/companyBaseHome',query:{companyId:scope.row.发行方ID}})"
              >
                {{ $t(scope.row['发行方名称']) }}
              </router-link>
              <div v-else style="overflow: hidden;text-overflow: ellipsis;">
                <span v-if="moneyList.includes(item.fieldName)" class="money-text">{{ $t(scope.row[item.fieldName]) }}</span>
                <span v-else>{{ $t(scope.row[item.fieldName]) }}</span>
              </div>
            </template>
          </el-table-column>
          <el-table-column :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width" width="120">
            <template slot="header">
              <i class="el-icon-s-tools" style="display: inline-block;margin: 0 auto!important;" @click="fieldChange(viewId)" />
            </template>
            <template slot-scope="scope">
              <el-dropdown trigger="click" placement="bottom" @visible-change="showMore($event,scope.row,scope.$index)">
                <span class="el-dropdown-link"><i class="el-icon-more" /></span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item
                    v-if="easyddEnable"
                    v-hasPermi="['deal:dealbase:edit']"
                    @click.native="companyHandle(scope.row)"
                  >{{ $t('尽调信息') }}</el-dropdown-item>
                  <el-dropdown-item
                    v-if="scope.row.showEditTeam"
                    v-hasPermi="['deal:team:view']"
                    @click.native="dealTeamHandle(scope.row)"
                  >{{ $t('项目成员') }}</el-dropdown-item>
                  <el-dropdown-item
                    v-if="scope.row.showDoc"
                    v-hasPermi="['deal:dealbase:view']"
                    @click.native="openFileFolder(scope.row)"
                  >{{ $t('项目文档') }}</el-dropdown-item>
                  <el-dropdown-item
                    v-if="dealType === 'property' && scope.row.showEditDeal"
                    v-hasPermi="['deal:dealbase:edit']"
                    @click.native="updatePropertyHandle(scope.row)"
                  >{{ $t('修改项目') }}</el-dropdown-item>
                  <el-dropdown-item
                    v-else-if="dealType === 'lease' && scope.row.showEditDeal"
                    v-hasPermi="['deal:dealbase:edit']"
                    @click.native="updateLeaseHandle(scope.row)"
                  >{{ $t('修改项目') }}</el-dropdown-item>
                  <el-dropdown-item
                    v-else-if="dealType === 'securities' && scope.row.showEditDeal"
                    v-hasPermi="['deal:dealbase:edit']"
                    @click.native="updateSecuritiesHandle(scope.row)"
                  >{{ $t('修改项目') }}</el-dropdown-item>
                  <el-dropdown-item
                    v-else-if="scope.row.showEditDeal"
                    v-hasPermi="['deal:dealbase:edit']"
                    @click.native="updateHandle(scope.row)"
                  >{{ $t('修改项目') }}</el-dropdown-item>
                  <el-dropdown-item
                    v-if="scope.row.showDelDeal"
                    v-hasPermi="['deal:dealbaseList:remove']"
                    @click.native="deleteHandle(scope.row)"
                  >{{ $t('删除项目') }}</el-dropdown-item>
                  <el-dropdown-item></el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="total>0"
          class="dealPage"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          :parameter="true"
          @pagination="getList"
          @currentChange="currentChange"
        />
        <!-- parameter只项目、基金用到 -->
      </div>
    </div>

    <!-- 添加或修改项目基本信息对话框 -->
    <el-dialog
      :title="$t('项目基本信息')"
      :width="dealBaseFormFlag ? undefined : '70%'"
      :visible.sync="formOpen"
      :close-on-click-modal="false"
      :lock-scroll="false"
      :destroy-on-close="dealBaseFormFlag==='configForm' || dealBaseFormFlag==='form'"
      :custom-class="dealBaseFormFlag==='form' ? 'magicalForm' : 'dialogForm'"
    >
      <Form v-if="dealBaseFormFlag==='form'" ref="form" :form-id-prop="formId" />
      <onlineForm v-else-if="dealBaseFormFlag==='configForm' && this.configFormDealType(dealType)" ref="onlineForm" cut-off-type="deal" />
      <dealBaseForm v-else ref="dealBaseForm" />
    </el-dialog>

    <!-- 持有型业务 -->
    <el-dialog :title="$t('项目基本信息')" :width="dealBaseFormFlag ? undefined : '70%'" :visible.sync="formPropertyOpen" :close-on-click-modal="false" :lock-scroll="false" :destroy-on-close="dealBaseFormFlag==='configForm'" :custom-class="dealBaseFormFlag==='form' ? 'magicalForm' : 'dialogForm'">
      <dealBasePropertyForm ref="dealBasePropertyForm" />
    </el-dialog>
    <!-- 租赁项目 -->
    <el-dialog :title="$t('项目基本信息')" :width="dealBaseFormFlag ? undefined : '70%'" :visible.sync="formLeaseOpen" :close-on-click-modal="false" :lock-scroll="false" :destroy-on-close="dealBaseFormFlag==='configForm'" :custom-class="dealBaseFormFlag==='form' ? 'magicalForm' : 'dialogForm'">
      <dealBaseLeaseForm ref="dealBaseLeaseForm" />
    </el-dialog>
    <!-- 证券投资基金 -->
    <el-dialog :title="$t('项目基本信息')" :width="dealBaseFormFlag ? undefined : '70%'" :visible.sync="formSecuritiesOpen" :close-on-click-modal="false" :lock-scroll="false" :destroy-on-close="dealBaseFormFlag==='configForm'" :custom-class="dealBaseFormFlag==='form' ? 'magicalForm' : 'dialogForm'">
      <dealBaseSecuritiesForm ref="dealBaseSecuritiesForm" />
    </el-dialog>

    <!-- 导入窗口 -->
    <el-dialog :title="$t('导入')" :visible.sync="upload.open" width="400px" :close-on-click-modal="false" :lock-scroll="false">
      <div>
        <el-upload
          ref="upload"
          v-loading="upload.isUploading"
          :limit="1"
          accept=".xlsx, .xls"
          :headers="upload.headers"
          :action="upload.url"
          :disabled="upload.isUploading"
          :on-progress="handleFileUploadProgress"
          :on-success="handleFileSuccess"
          :on-exceed="handleFileExceed"
          :on-change="handleFileChange"
          :auto-upload="false"
          drag
        >
          <i class="el-icon-upload" />
          <div class="el-upload__text">
            {{ $t('将文件拖到此处，或') }}
            <em>{{ $t('点击上传') }}</em>
          </div>
          <div slot="tip" class="el-upload__tip" style="color:red">
            {{ $t('提示：仅允许导入“xls”或“xlsx”格式文件！') }}
            <el-link type="primary" style="font-size:12px" @click="fetchTemplate">
              {{ $t('下载模板') }}
            </el-link>
          </div>
        </el-upload>

        <div slot="footer" class="dialog-footer" style="text-align: right;">
          <el-button @click="upload.open = false">{{ $t("取消") }}</el-button>
          <el-button type="primary" @click="submitFileForm">{{ $t("确定") }}</el-button>
        </div>
      </div>
    </el-dialog>
    <!-- 新建视图 -->
    <el-dialog v-el-drag-dialog :title="$t('新建视图')" :visible.sync="newView" width="70%" :close-on-click-modal="false" :lock-scroll="false" custom-class="dialogForm">
      <sysSearchMainForm ref="sysSearchMainForm" :module="searchKey" />
    </el-dialog>
    <!-- 管理视图 -->
    <el-dialog v-el-drag-dialog :title="$t('管理视图')" :visible.sync="oddView" width="50%" :close-on-click-modal="false" :lock-scroll="false" :before-close="handleDialogClose">
      <sysSearchMainList ref="sysSearchMainList" :module="searchKey" :view-id="viewId" />
    </el-dialog>
    <el-dialog v-el-drag-dialog :title="$t('保存视图')" :visible.sync="saveViewOpen" width="50%" :close-on-click-modal="false" :lock-scroll="false">
      <div>
        <el-form ref="saveForm" :model="saveForm" :rules="saveViewRules">
          <el-form-item :label="$t('视图名称')" prop="name">
            <el-input v-model="saveForm.name" :placeholder="$t('视图名称')" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer" style="text-align: right;">
          <el-button @click="cancel">{{ $t("取消") }}</el-button>
          <el-button type="primary" @click="saveView">{{ $t("确定") }}</el-button>
        </div>
      </div>
    </el-dialog>
    <!-- fieldShow -->
    <el-dialog v-el-drag-dialog :title="$t('展示字段(字段可拖拽排序)')" :visible.sync="fieldShow" width="50%" :close-on-click-modal="false" :lock-scroll="false" :before-close="handleDialogClose" custom-class="dialogForm">
      <fieldShow ref="fieldShow" />
    </el-dialog>
    <!-- 文档库 -->
    <el-dialog v-if="fileFolderOpen" :title="$t('文档库')" :visible.sync="fileFolderOpen" :destroy-on-close="true" :close-on-click-modal="false" custom-class="folderOpen" :lock-scroll="false" append-to-body>
      <file-folder ref="fileFolder" :folder-bus-type="folderBusType" :folder-bus-id="businessDealId" />
    </el-dialog>
    <!-- 项目成员 -->
    <el-dialog :title="$t('团队成员')" :visible.sync="dealTeamOpen" :close-on-click-modal="false" custom-class="folderOpen" :lock-scroll="false" append-to-body>
      <dealTeamList ref="dealTeamList" :deal-id="businessDealId" />
    </el-dialog>
  </div>
</template>
<script>
  import dealTeamList from '@/views/deal/team/dealTeamList.vue'
  import fileFolder from '@/views/folder/index.vue'
  import sysSearchMainForm from '../../system/search/sysSearchMainForm'
  import sysSearchMainList from '../../system/search/sysSearchMainList'
  import fieldQuery from '../../system/search/fieldQuery'
  import fieldShow from '../../system/search/fieldShow'
  import dealBaseLeaseForm from '@/views/deal/base/lease/dealBaseLeaseForm.vue'
  import { delDealBase, exportDealBase, reSaveDealBase } from '@/api/base/deal/dealBase'
  import { getByUser, getDataListByView, getDealSum, viewSave } from '@/api/system/search/searchMainView'
  import { getToken } from '@/utils/auth'
  import Focus from '@/components/Focus/star'
  import Form from '@/views/dev/form/base/form'
  import { getConfigKey } from '@/api/system/config'
  import dealBaseForm from './dealBaseForm.vue'
  import dealBasePropertyForm from '@/views/deal/base/dealBasePropertyForm.vue'
  import onlineForm from '@/views/system/desform/release/onlineForm.vue'
  import dealBaseSecuritiesForm from '@/views/deal/base/securities/dealBaseSecuritiesForm.vue'
  import { config } from '@/utils'
  import { getPermission } from '@/api/system/dealRole/dealRole'

  export default {
    components: {
      fieldShow,
      fieldQuery,
      sysSearchMainList,
      sysSearchMainForm,
      Focus,
      Form,
      dealBaseForm,
      fileFolder,
      dealTeamList,
      dealBasePropertyForm,
      onlineForm,
      dealBaseSecuritiesForm,
      dealBaseLeaseForm
    },
    data() {
      return {
        // 菜单标识-用来查询项目内菜单
        data: [],
        menuKey: '',
        dealSum: {},
        moneyList: [],
        // 高级查询的key
        searchKey: '',
        // 项目状态
        dealStatus: this.$route.query.dealStatus,
        // 项目状态
        dealType: '',
        hasPermiBtn: 'deal:dealbase:' + (this.isEmpty(this.$route.query.dealStatus) ? (this.isEmpty(this.$route.query.dealType) ? '' : this.$route.query.dealType.toLowerCase()) : this.$route.query.dealStatus.toLowerCase()) + 'add',
        hasPermiExportBtn: 'deal:dealbase:' + (this.isEmpty(this.$route.query.dealStatus) ? (this.isEmpty(this.$route.query.dealType) ? '' : this.$route.query.dealType.toLowerCase()) : this.$route.query.dealStatus.toLowerCase()) + 'export',
        hasPermiImportBtn: 'deal:dealbase:' + (this.isEmpty(this.$route.query.dealStatus) ? (this.isEmpty(this.$route.query.dealType) ? '' : this.$route.query.dealType.toLowerCase()) : this.$route.query.dealStatus.toLowerCase()) + 'import',
        selected: false,
        oddView: false,
        newView: false,
        fieldShow: false,
        dealTeamOpen: false,
        // 遮罩层
        loading: true,
        // 总条数
        total: 0,
        // 项目基本信息表格数据
        dealBaseList: [],
        showFieldList: [],
        // 是否显示弹出层
        formOpen: false,
        formPropertyOpen: false,
        // 租赁项目弹出层
        formLeaseOpen: false,
        // 证券基金投资
        formSecuritiesOpen: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          // 查询产生集合
          paramsMap: {
          },
          searchOrderByVo: {
            prop: '',
            order: ''
          }
        },
        listSysSearch: [],
        // 表单参数
        form: {},
        // 表单校验
        rules: {},
        viewId: '',
        activeItem: '',
        searchQueryList: [],
        // 项目导入参数
        upload: {
          // 是否显示弹出层（项目导入）
          open: false,
          // 弹出层标题（项目导入）
          title: '',
          // 是否禁用上传
          isUploading: false,
          // 设置上传的请求头部
          headers: { Authorization: 'Bearer ' + getToken() },
          // 上传的地址
          url: process.env.VUE_APP_BASE_API + '/deal/dealBase/importData'
        },
        formId: this.$route.query.formId,
        dealBaseFormFlag: '',
        easyddEnable: false,
        fileFolderOpen: false,
        folderBusType: undefined,
        businessDealId: undefined,
        menuLoading: false,
        dealBaseFormTempletId: '',
        groupField: undefined,
        group: {},
        treeLoading: true,
        saveViewOpen: false,
        saveForm: {
          name: undefined
        },
        saveViewRules: {
          name: [{ required: true, message: this.$t('必填信息'), trigger: ['change', 'blur'] }]
        },
        showSaveBtn: false
      }
    },
    watch: {
      '$route': {
        handler(val) {
          this.searchKey = val.query.searchKey
          this.menuKey = val.query.menuKey
          this.dealStatus = val.query.dealStatus
          this.dealType = val.query.dealType
          this.upload.headers.dealType = this.dealType || 'equity'
          // 母基金直投项目, 子基金
          if (val.query.paramsMap && val.query.paramsMap.investorId !== undefined) {
            this.queryParams.paramsMap = { investorId: val.query.paramsMap.investorId }
          }
          this.load(this.searchKey)
        },
        deep: true,
        immediate: true
      }
    },
    created() {
      var pageSize = Number(this.$store.state.app.pageSize)
      if (pageSize > 0) {
        this.queryParams.pageSize = pageSize
      }
      getConfigKey('easydd').then(res => {
        console.log(res)
        this.easyddEnable = (res.msg === 'true')
      })
      this.$nextTick(() => {
        getConfigKey('deal_base_form').then(res => {
          this.dealBaseFormFlag = res.msg
        })
      })
      getConfigKey('dealTempletId').then((res) => {
        this.dealBaseFormTempletId = res.msg
      })
    },
    mounted() {
      this.$nextTick(() => {
        // this.getViewList()
      })
    },
    methods: {
      starChange() {
        this.updateView()
      },
      showMore(e, row, index) {
        this.menuLoading = true
        if (e) {
          getPermission(row['项目ID'], 'deal', 'deal_' + this.$route.query.dealType).then(res => {
            if (res.data) {
              console.log(res.data)
              var arr = res.data.hasPerm
              // var menus = res.data.menus[0].children
              // var menus = []
              console.log(res.data.menus)
              var menuResult = res.data.menus[0].children.find(item => item.menuKey === 'deal_data_after')
              // console.log(menuResult, '项目菜单')
              // if (menuResult) {
              //   menus = menuResult.children
              // } else {
              //   this.$message.error(this.$t('暂无权限'))
              // }
              if (!menuResult) {
                this.$message.error(this.$t('暂无权限'))
                return
              }

              if (arr.includes('deal:dealbase:edit')) {
                this.dealBaseList[index].showEditDeal = true
              } else {
                this.dealBaseList[index].showEditDeal = false
              }
              if (arr.includes('deal:dealbase:remove')) {
                this.dealBaseList[index].showDelDeal = true
              } else {
                this.dealBaseList[index].showDelDeal = false
              }
              if (arr.includes('deal:team:edit')) {
                this.dealBaseList[index].showEditTeam = true
              } else {
                this.dealBaseList[index].showEditTeam = false
              }
              if (arr.includes('deal:doc:view')) {
                this.dealBaseList[index].showDoc = true
              } else {
                this.dealBaseList[index].showDoc = false
              }
              // var menu = menus.find(item => item.menuKey === 'project_document')
              // if (menu) {
              //   this.dealBaseList[index].showDoc = true
              // } else {
              //   this.dealBaseList[index].showDoc = false
              // }
            } else {
              this.dealBaseList[index].showEditDeal = true
              this.dealBaseList[index].showDelDeal = true
              this.dealBaseList[index].showEditTeam = true
              this.dealBaseList[index].showDoc = true
            }
            var result = JSON.parse(JSON.stringify(this.dealBaseList))
            this.dealBaseList = []
            this.dealBaseList = result
            this.menuLoading = false
          })
        } else {
          this.menuLoading = false
        }
      },
      load(val) {
        this.loading = true
        // 定位勾选视图
        getByUser(val, this.queryParams.paramsMap).then(response => {
          this.listSysSearch = response.data
          if (localStorage.getItem('activeIdDeal') === 'undefined') {
            this.sysSearchActive(response.data[0])
          } else {
            const index = response.data.findIndex(children => children.viewId === localStorage.getItem('activeIdDeal'))
            if (index !== -1) {
              this.sysSearchActive(response.data[index])
            } else {
              this.sysSearchActive(response.data[0])
            }
          }
        })
      },
      calcSum() {
        getDealSum(this.queryParams).then(res => {
          this.dealSum = res.data && res.data.length > 0 ? res.data[0] : null
          this.moneyList = []
          for (var i in this.dealSum) {
            this.moneyList.push(i)
          }
        })
      },
      // 字段查询
      getQueryData(data, isNotLeft = true) {
        if (!(this.searchQueryList instanceof Array)) {
          this.$set(this, 'searchQueryList', [])
        }
        this.$nextTick(() => {
          var searchQueryTempList = []
          this.searchQueryList.forEach(item => {
            if (item.fieldName !== data.fieldName) {
                searchQueryTempList.push(item)
            }
          })
          this.searchQueryList = searchQueryTempList
          if (data.value !== '' || data.conditions !== '') {
            this.searchQueryList.push(data)
          }
          this.queryParams.searchQueryVoList = this.searchQueryList
          // this.getList(this.searchQueryList)
            this.loading = true
            this.dealBaseList = []
            this.calcSum()
            getDataListByView(this.queryParams).then(res => {
              this.dealBaseList = res.data.rows
              this.total = res.data.total
              this.loading = false
              if (this.groupField && this.groupField !== '' && isNotLeft) {
                this.groupData(this.group)
              }
            })
          })
      },
      updateView() { // 只更新视图
        getByUser(this.$route.query.searchKey).then(response => {
          this.listSysSearch = response.data
        })
      },
      // 分组
      groupData(e, showSaveBtn = true) {
        console.log(e)
        // 加载左侧分组树
        this.group = e
        this.showSaveBtn = showSaveBtn
        this.getLeftGroupTree(e)
      },
      handlerClick(data) {
        this.group.conditions = data[data['field']] === null ? 'WK' : 'HDY'
        this.group.value = data[data['field']]
        this.group.group = true
        console.log(this.searchQueryList, '条件列表')
        console.log(this.group, data, this.groupField)
        this.getQueryData(this.group, false)
      },
      getSummaries(param) {
        const { columns } = param
        const sums = []
        columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = '合计'
          }
          if ((this.dealSum && this.dealSum[column.property]) || (this.dealSum && this.dealSum[column.property]) === 0) {
            sums[index] = this.dealSum[column.property]
          }
        })

        return sums
      },
      closeGroup() {
        if (this.groupField) {
          this.showSaveBtn = false
        }
        var queryList = JSON.parse(JSON.stringify(this.searchQueryList))
        queryList.forEach((item, index) => {
          if (item.group) {
            this.searchQueryList.slice(index, 1)
          }
        })
        this.data = []
        this.group = {}
        this.groupField = undefined
      },
      // 获取左侧分组树
      getLeftGroupTree(query) {
        this.treeLoading = true
        this.queryParams.groupField = query.fieldName
        this.calcSum()
        getDataListByView(this.queryParams).then(res => {
          this.data = res.data
          this.groupField = this.queryParams.groupField
          this.queryParams.groupField = undefined
          this.treeLoading = false
        })
      },
      // 保存视图
      saveView() {
        this.$refs.saveForm.validate(valid => {
          if (valid) {
            // 初始化保存对象
            var queryList = JSON.parse(JSON.stringify(this.searchQueryList))
            this.saveForm.color = ''
            this.saveForm.sqlBaseId = this.$route.query.searchKey
            this.saveForm.groupField = this.groupField
            this.saveForm.searchMainGroupList = []
            queryList.forEach(item => {
              item.fieldId = item.fieldName
              item.fieldValue = item.value
            })
            this.saveForm.searchMainGroupList.push({
              relation: 'and',
              groupField: this.groupField,
              searchMainConditionsList: queryList
            })
            this.saveForm.dataId = this.viewId
            viewSave(this.saveForm).then(res => {
              if (res.code === 200) {
                this.$message.success(this.$t('保存成功'))
                this.cancel(res)
                this.load(this.searchKey)
              }
            })
          }
        })
      },
      openSaveView() {
        this.saveViewOpen = true
      },
      // 删除，排序，新增只刷新视图
      getViewList(id) {
        // 查询高级查询列表
        const rows = []
        this.updateView()
        this.listSysSearch.forEach(item => {
          rows.push(item.viewId)
        })
        // 删除当前选中视图，重新定位视图
        if (!rows.includes(localStorage.getItem('activeIdDeal'))) {
          this.sysSearchActive(this.listSysSearch[0])
        }
        // 修改当前视图应刷新列表
        if (id === localStorage.getItem('activeIdDeal')) {
          this.getList()
        }
      },
      // 管理视图
      managementView() {
        this.oddView = true
        if (this.$refs.sysSearchMainList) {
          this.$refs.sysSearchMainList.getList()
        }
      },
      // 新建视图
      addView() {
        this.newView = true
        if (this.$refs.sysSearchMainForm) {
          this.$refs.sysSearchMainForm.init()
        }
      },
      // 弹窗关闭按钮
      handleDialogClose() {
        this.oddView = false
        this.fieldShow = false
        this.getViewList()
      },
      // 查询项目
      sysSearchActive(data) {
        if (data?.viewId !== undefined) {
          this.activeItem = this.viewId = data.viewId
          localStorage.setItem('activeIdDeal', data.viewId)
          this.$nextTick(function() {
            // 项目列表
            this.queryParams.viewId = data.viewId
            this.searchQueryList = []
            this.queryParams.searchQueryVoList = []
            this.getList(data.groupField, data.searchQueryVoList)
          })
        }
      },
      // 查询数据
      getList(fieldId = undefined, cond = []) {
        console.log('list')
        this.loading = true
        this.treeLoading = true
        this.showFieldList = this.dealBaseList = []
        this.calcSum()
        getDataListByView(this.queryParams).then(res => {
          this.showFieldList = res.datas.showFieldList
          this.dealBaseList = res.data.rows
          this.total = res.data.total
          if (fieldId && (typeof fieldId === 'string')) {
            if (cond && cond.length > 0) {
              this.searchQueryList = cond
              var obj = cond.find(item => item.fieldName === fieldId)
              if (!obj) {
                var type = this.showFieldList.find(item => item.fieldName === fieldId)
                obj = {
                  type: type.type,
                  fieldName: fieldId,
                  value: undefined,
                  conditions: 'HDY'
                }
              }
              this.groupData(obj, false)
            } else {
              console.log(fieldId)
              type = this.showFieldList.find(item => item.fieldName === fieldId)
              obj = {
                type: type.type,
                fieldName: fieldId,
                value: undefined,
                conditions: 'HDY'
              }
              this.groupData(obj, false)
            }
          } else {
            this.closeGroup()
          }
          this.loading = false
          this.treeLoading = false
        })
      },
      // 展示字段
      fieldChange(id) {
        this.fieldShow = true
        this.$nextTick(() => {
          if (this.$refs.fieldShow) {
            this.$refs.fieldShow.getListById(id)
          }
        })
      },
      // 删除数据
      handleDelete(index) {
        this.$confirm(this.$t('是否永久删除该数据?'), this.$t('提示'), {
          confirmButtonText: this.$t('确定'),
          cancelButtonText: this.$t('取消'),
          type: 'warning'
        })
          .then(() => {
            this.tableform.splice(index, 1)
            this.$message({
              showClose: true,
              type: 'success',
              message: this.$t('删除成功')
            })
          })
          .catch(err => {
            this.$message({
              type: 'error',
              message: err
            })
          })
      },
      // 表单重置
      reset() {
        this.form = {
          id: undefined,
          dealName: undefined,
          dealNamePinyin: undefined,
          personCharge: undefined,
          dealType: undefined,
          companyId: undefined,
          industryFocus: undefined,
          dealSource: undefined,
          dateTouchFirst: undefined,
          dateInvestmentEstimate: undefined,
          amountInvestmentEstimate: undefined,
          currency: undefined,
          roundsInvestment: undefined,
          levelConcern: undefined,
          valuationBeforeInvestment: undefined,
          dealIntroduction: undefined,
          dealStrongPoint: undefined,
          dealScruple: undefined,
          managementModePostInvestment: undefined,
          planExit: undefined,
          createBy: undefined,
          createTime: undefined,
          updateBy: undefined,
          updateTime: undefined,
          remark: undefined,
          delFlag: undefined
        }
        this.resetForm('form')
      },
      /** 新增按钮操作 */
      addHandle() {
        this.formOpen = true
        this.$nextTick(() => {
          var data = {}
          data.dealStatus = this.dealStatus
          data.dealType = this.dealType
          const dt = this.$route.query.dealType
          if (this.dealBaseFormFlag === 'form') {
            data.formId = this.formId
            this.$refs.form.init(data)
          } else if (this.dealBaseFormFlag === 'configForm' && this.configFormDealType(dt)) { // 表单配置只支持 股权/债权/参股
                  this.$nextTick(() => {
                     this.$refs.onlineForm.initId(this.dealBaseFormTempletId)
                     this.$refs.onlineForm.init(null)
                     // 增加一个标识 标记从项目跳到 表单配置的
                  })
          } else {
              this.$refs.dealBaseForm.init(data)
          }
        })
      },
      // 持有型业务新增
      addPropertyHandle() {
        this.formPropertyOpen = true
        this.$nextTick(() => {
          var data = {}
          data.dealStatus = this.dealStatus
          data.dealType = this.dealType
          this.$refs.dealBasePropertyForm.init(data)
        })
      },
      addLeaseHandle() {
        this.formLeaseOpen = true
        this.$nextTick(() => {
          this.$refs.dealBaseLeaseForm.init({ dealStatus: this.dealStatus, dealType: this.dealType })
        })
      },
      /** 修改按钮操作 */
      updateHandle(row) {
        this.formOpen = true
        this.$nextTick(() => {
          row.id = row.项目ID
          row.dealType = this.dealType
          if (this.dealBaseFormFlag === 'form') {
            this.$refs.form.init(row)
          } else if (this.dealBaseFormFlag === 'configForm' && this.configFormDealType(this.dealType)) {
                  this.$nextTick(() => {
                    this.$refs.onlineForm.initId(this.dealBaseFormTempletId)
                     this.$refs.onlineForm.init(row)
                  })
          } else {
            this.$refs.dealBaseForm.init(row)
            this.$refs.dealBaseForm.$refs.form.clearValidate()
          }
        })
      },
      /** 持有型修改 */
      updatePropertyHandle(row) {
        this.formPropertyOpen = true
        this.$nextTick(() => {
          row.id = row.项目ID
          row.dealType = this.dealType
          if (!this.dealBaseFormFlag) {
            this.$refs.form.init(row)
          } else {
            this.$refs.dealBasePropertyForm.init(row)
            this.$refs.dealBasePropertyForm.$refs.form.clearValidate()
          }
        })
      },
      /** 修改融资租赁 */
      updateLeaseHandle(row) {
        this.formLeaseOpen = true
        this.$nextTick(() => {
          row.id = row.项目ID
          row.dealType = this.dealType
          if (!this.dealBaseFormFlag) {
            this.$refs.form.init(row)
          } else {
            this.$refs.dealBaseLeaseForm.init(row)
            this.$refs.dealBaseLeaseForm.$refs.form.clearValidate()
          }
        })
      },
      addSecuritiesHandle() {
        this.formSecuritiesOpen = true
        this.$nextTick(() => {
          var data = {}
          data.dealStatus = this.dealStatus
          data.dealType = this.dealType
          this.$refs.dealBaseSecuritiesForm.init(data)
        })
      },
      updateSecuritiesHandle(row) {
        this.formSecuritiesOpen = true
        this.$nextTick(() => {
          row.id = row.项目ID
          row.dealType = this.dealType
          if (!this.dealBaseFormFlag) {
            this.$refs.form.init(row)
          } else {
            this.$refs.dealBaseSecuritiesForm.init(row)
            this.$refs.dealBaseSecuritiesForm.$refs.form.clearValidate()
          }
        })
      },
      // 快速打开文档库
      openFileFolder(row) {
        this.fileFolderOpen = true
        this.businessDealId = row.项目ID
        this.folderBusType = this.dealType
        this.$nextTick(() => {
          this.$refs.fileFolder.addOneFolderSwitch = false
          this.$refs.fileFolder.dealBaseId = row.项目ID
        })
      },
      // 项目成员
      dealTeamHandle(row) {
        this.dealTeamOpen = true
        this.businessDealId = row.项目ID
      },
      // 易尽调
      companyHandle(row) {
        console.log(row)
        if (!row.项目ID) {
          // 如果报错. 检查默认检索是否变动
          this.msgError('发生异常, 请联系管理员!')
        } else {
          // 重新获取公司信息
          this.loading = true
          reSaveDealBase({ 'id': row.项目ID }).then(response => {
            if (response.data.easyddId !== undefined && response.data.easyddId !== null && response.data.easyddId !== '') {
              window.open(config.easyddUrl + '/outConnect/company/base/companyBaseHome?companyId=' + response.data.easyddId + '&token=' + getToken())
            } else {
              this.$alert(this.$t('未查询到该公司的尽调信息, 请输入工商信息可查询到的公司名称!'), this.$t('提示'), {
                confirmButtonText: this.$t('关闭'),
                type: 'warning',
                callback: () => {}
              })
            }
            this.loading = false
          })
        }
      },
      /** 删除按钮操作 */
      deleteHandle(row) {
        this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
          confirmButtonText: this.$t('确定'),
          cancelButtonText: this.$t('取消'),
          type: 'warning'
        }).then(function() {
          row.id = row.项目ID
          return delDealBase(row.id)
        }).then(() => {
          this.getList()
          this.getViewList()
          this.msgSuccess(this.$t('删除成功'))
        }).catch(function() {
        })
      },
      /** 导出按钮操作 */
      exportHandle() {
        const queryParams = this.queryParams
        this.$confirm(this.$t('是否确认导出?'), this.$t('警告'), {
          confirmButtonText: this.$t('确定'),
          cancelButtonText: this.$t('取消'),
          type: 'warning'
        }).then(function() {
          return exportDealBase(queryParams)
        }).then(response => {
          this.download(response.msg)
        }).catch(function() {
        })
      },
      // 分页保持排序
      currentChange() {
        this.loading = true
        this.calcSum()
        getDataListByView(this.queryParams).then(res => {
          this.dealBaseList = res.data.rows
          this.loading = false
        })
      },
      // 排序
      dataSort(column) {
        this.loading = true
        this.queryParams.pageNum = 1
        this.queryParams.viewId = this.viewId
        var searchOrderByVo = {}
        searchOrderByVo.prop = column.prop
        searchOrderByVo.order = column.order
        this.queryParams.searchOrderByVo = searchOrderByVo
        this.calcSum()
        getDataListByView(this.queryParams).then(res => {
          this.dealBaseList = res.data.rows
          this.loading = false
        })
      },
      // 文件上传中处理
      handleFileUploadProgress() {
        this.upload.isUploading = true
      },
      // 文件上传成功处理
      handleFileSuccess(response) {
        this.upload.open = false
        this.upload.isUploading = false
        this.$refs.upload.clearFiles()
        if (response.msg === 'success') {
          this.msgSuccess(this.$t('导入成功'))
        } else if (response.code === 500) {
          this.msgError(response.msg)
        } else {
          this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true })
        }
        // this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
        this.getList()
      },
      // 提交上传文件
      submitFileForm() {
        this.$refs.upload.submit()
      },
      // 文件达到上限处理
      handleFileExceed() {
        this.msgError(this.$t('可上传文件数量已达到上限'))
      },
      // 文件上传变更时间
      handleFileChange(file, fileList) {
        if (!(file.name.indexOf('xls') >= 0 && file.name.indexOf('xlsx') >= 0)) {
          this.msgError(this.$t('仅允许导入“xls”或“xlsx”格式文件！'))
          fileList.splice(0, 1)
        }
      },
      // 下载模板
      fetchTemplate() {
        var href1 = window.location.href
        var href2 = this.$route.path
        var url = href1.substring(0, href1.indexOf(href2))
        // 根据项目类型下载不同的模板
        var templateRoute = ''
        var dealType = this.dealType || 'equity'
        if (dealType === 'equity') {
          templateRoute = '/template/equityImportTemplate.xlsx'
        } else if (dealType === 'debt') {
          templateRoute = '/template/claimsImportTemplate.xlsx'
        } else if (dealType === 'bf') {
          templateRoute = '/template/equityFundsImportTemplate.xlsx'
        } else if (dealType === 'estate') {
          templateRoute = '/template/realEstateImportTemplate.xlsx'
        } else if (dealType === 'property') {
          templateRoute = '/template/propertyImportTemplate.xlsx'
        } else if (dealType === 'lease') {
          templateRoute = '/template/leaseImportTemplate.xlsx'
        } else if (dealType === 'securities') {
          templateRoute = '/template/securitiesImportTemplate.xlsx'
        } else if (dealType === 'bond') {
          templateRoute = '/template/bondImportTemplate.xlsx'
        }
        if (templateRoute !== '') {
          window.location.href = url + templateRoute
        }
      },
      // 导出项目
      exportDeal() {
        this.downLoadExcelPost('/view/searchMainView/export', this.queryParams).then(() => {
          this.msgSuccess(this.$t('导出成功'))
        })
      },
      cancel() {
        this.formOpen = false
        this.saveViewOpen = false
        this.getList()
      },
      // 验证是否配置过该项目类型的页面
      configFormDealType(type) {
        var dealTypes = ['equity', 'debt', 'bf', 'anxin', 'KH', 'SAAS', 'market', 'HZHB', 'self_dev']
        if (type && dealTypes.indexOf(type) !== -1) {
          return true
        } else {
          return false
        }
      }
    }
  }
</script>
<style lang="scss" scoped>
.list-row{
  .el-select{
    margin-bottom: 5px;
    width: 75%;
  }
}

  .newMess .el-form,
  .newMess .el-table {
    margin-bottom: 20px;
  }

  li {
    list-style: none;
  }
  .list-views {
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    height: 52px;
    display: flex;
    margin: 0;
    padding: 0;
    overflow-x:auto ;
  }
  .tag-number {
    font-family: PingFangSC-Medium;
    font-size: 20px;
    color: #fff;
    line-height: 20px;
  }
  .tag-label {
    font-family: PingFangSC-Regular;
    font-size: 12px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    max-width: 90px;
  }

  .list-views li.selected:after {
    position: absolute;
    content: "";
    display: block;
    top: 1px;
    right: 4px;
    width: 4px;
    height: 7px;
    border-style: solid;
    border-color: white;
    border-width: 0 2px 2px 0;
    transform: rotateZ(45deg);
  }
  .list-views li {
    margin-right: 10px;
    font-size: 12px;
    border-radius: 2px;
    width: 120px;
    min-width: 100px;
    height: 50px;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    cursor: pointer;
    background: #a4afeb;
    text-align: center;
    display: flex;
    position: relative;
  }
  .tag-views-title {
    display: inline-block;
    float: left;
    font-size: 14px;
  }
  .table-grid-content {
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
  }

  .table-input {
    outline-style: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 200px;
    font-size: 14px;
    height: 30px;
  }

  .el-table td {
    padding: 4px 0;
    font-size: 13px;
  }

  .list-table {
    padding: 10px;
    -webkit-box-shadow: 0 3px 12px 2px rgba(218, 223, 232, 0.5);
    box-shadow: 0 3px 12px 2px rgba(218, 223, 232, 0.5);
    border: 1px solid #ebeef5;
    background-color: #fff;
    color: #303133;
    -webkit-transition: 0.3s;
    transition: 0.3s;
    border-radius: 4px;
    overflow: hidden;
  }

  .el-table__header th {
    background-color: #f6f7fb !important;
    padding: 2px 0;
  }

  .el-table .cell {
    white-space: nowrap;
  }

  .el-dialog {
    width: 800px;
  }

  .list-left {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    padding-left: 10px;
  }

  .module-list-switch {
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .module-list-switch .list-switch {
    background: #f6f7fb;
    border-right: 1px solid #e6e9f5;
    width: 18px;
    height: 126px;
    font-size: 12px;
    color: #9da2b3;
    text-align: center;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    cursor: pointer;
    line-height: 16px;
  }

  .module-list-switch .list-switch i {
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    vertical-align: initial;
    height: 100%;
    display: flex;
    font-style: normal;
  }

  .shai-side-collapsed {
    width: 220px;
    border-right: 1px solid #e6e9f5;
  }

  .shai-side-expanded {
    width: 0px;
    display: none;
  }

  .slideInRight,
  .Table-table {
    display: flex;
  }

  .slideInRight {
    margin-right: 10px;
    height: 500px;
    margin-left: -10px;
  }

  .list-left .left-header {
    height: 40px !important;
    padding: 0;
    font-size: 14px;
    padding-right: 10px;
  }

  .list-left .left-main {
    margin-top: 10px;
    height: calc(100% - 85px);
    margin-bottom: 5px;
    overflow: auto;
    padding: 0;
  }

  .list-left .left-main .el-checkbox {
    display: block;
    margin-bottom: 5px;
  }
  .list-row {
    margin-bottom: 10px;
    width: 165px;
  }

  .list-left .left-footer {
    height: 33px !important;
    padding: 0;
    text-align: right;
    margin-right: 15px;
  }
  .field .el-transfer-panel {
    width: 260px !important;
  }
  .el-pagination {
    text-align: right;
    margin-top: 10px;
  }
  .tableDiv {
    position: relative;
    overflow: hidden;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    width: 100%;
    max-width: 100%;
    font-size: 14px;
    color: #606266;
  }
  .btnDiy {
    text-align: right;
  }
  .btnDiy button {
    padding: 8px 20px;
    border-radius: 0px;
  }
  .btnDiy .el-button + .el-button {
    margin-left: 0px;
  }

  .viewItem {
    margin: 15px 0 10px;
  }
  /deep/ .el-dropdown, .el-icon-s-tools{
    cursor: pointer;
  }
  /deep/ .el-dropdown-menu__item{
    white-space: nowrap;
  }

/deep/.table .el-table__fixed {
  height: calc(100% + 17px) !important;
  .el-table__fixed-footer-wrapper {
    bottom: 17px;
  }
}
/deep/.table .el-table__fixed-right {
  height: calc(100% + 17px) !important;
  .el-table__fixed-footer-wrapper {
    bottom: 17px;
  }
}
/** 合计行内容靠右 */
/deep/.el-table .el-table__footer-wrapper .cell{
  text-align: right;
}
.hide-add-deal-list-btn {
  position: absolute;
  right: 0;
  width: 245px;
  height: 50px;
  border: 1px white solid;
  float: right;
  margin-top: -40px;
  background: white;
}
</style>
